package com.whm.hrmanagement.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.whm.hrmanagement.domain.OaSocCity;
import com.whm.hrmanagement.domain.vo.OaSalaryVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 参保城市Mapper接口
 * 
 * @author whm
 * @date 2024-02-09
 */
public interface OaSocCityMapper 
{
    /**
     * 查询参保城市
     * 
     * @param id 参保城市主键
     * @return 参保城市
     */
    public OaSocCity selectOaSocCityById(String id);

    /**
     * 查询参保城市列表
     * 
     * @param oaSocCity 参保城市
     * @return 参保城市集合
     */
    public List<OaSocCity> selectOaSocCityList(OaSocCity oaSocCity);

    /**
     * 新增参保城市
     * 
     * @param oaSocCity 参保城市
     * @return 结果
     */
    public int insertOaSocCity(OaSocCity oaSocCity);


    @Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name,si.per_social_pay social_pay,si.per_house_pay house_pay " +
            "from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id left join soc_insurance si on ss.id = si.staff_id where ss.is_deleted = 0")
    List<OaSalaryVo> findStaffSalaryVO();


    @Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name,si.per_social_pay social_pay,si.per_house_pay house_pay " +
            "from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id left join soc_insurance si on ss.id = si.staff_id where ss.is_deleted = 0 and ss.name like concat('%',#{name},'%')")
    IPage<OaSalaryVo> listStaffSalaryVO(@Param("name") String name);

    @Select("select ss.id staff_id,ss.dept_id,ss.code,ss.name,ss.phone,ss.address,sd.name dept_name,si.per_social_pay social_pay,si.per_house_pay house_pay " +
            "from sys_staff ss inner join sys_dept sd on ss.dept_id = sd.id left join soc_insurance si on ss.id = si.staff_id where ss.is_deleted = 0 and ss.dept_id = #{deptId} and ss.name like concat('%',#{name},'%')")
    IPage<OaSalaryVo> listStaffDeptSalaryVO( @Param("name") String name, @Param("deptId")Integer deptId);
    /**
     * 修改参保城市
     * 
     * @param oaSocCity 参保城市
     * @return 结果
     */
    public int updateOaSocCity(OaSocCity oaSocCity);

    /**
     * 删除参保城市
     * 
     * @param id 参保城市主键
     * @return 结果
     */
    public int deleteOaSocCityById(String id);

    /**
     * 批量删除参保城市
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOaSocCityByIds(String[] ids);
}
